package com.water.locationservice.controller;

import com.alibaba.fastjson.JSONObject;
import com.water.locationservice.entites.CommonResult;
import com.water.locationservice.service.LocationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 汪胜彬
 * @version 1.0
 */

@RestController
@Slf4j
public class LocationController
{


    @Resource
    LocationService locationService;

    @GetMapping("/location/get")
    public CommonResult getLocation()
    {
        String locationInfo = locationService.getLocation();
        log.info("commonResult: " + locationInfo);
        CommonResult<String> commonResult = new CommonResult(200, null, locationInfo);
        return commonResult;
    }
}
